<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // https://leetcode-cn.com/problems/reverse-string/
        // 简单题
        var reverseString = function(s) {
            for (let i = 0; i < Math.floor(s.length / 2); i++) {
                let tmp = s[i];
                s[i] = s[s.length - 1 - i];
                s[s.length - 1 - i] = tmp;
            }
            return s;
        };
        console.log(reverseString(["h","e","l","l","o"]));
    </script>
</body>
</html>